/**
 * 
 */
package com.et114.test.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

import com.et114.core.action.AbstractUploadAction;

/**
 * @author guanhw
 *
 */
public class UploadAction extends AbstractUploadAction {
	
	/**
	 * 
	 */
	public UploadAction ( ) {
		// TODO Auto-generated constructor stub
	}

	protected ActionForward upload ( ActionMapping mapping , ActionForm form ,
			HttpServletRequest request , HttpServletResponse response ) throws Exception  {
		// TODO Auto-generated method stub
		UploadForm uploadForm = ( UploadForm ) form;
		java.util.Map map = uploadForm.getMap ( );
			for ( java.util.Iterator iter = map.keySet ( ).iterator ( ) ; iter.hasNext ( ) ;  ) {
				Object key = iter.next ( ) ;
				FormFile file = uploadForm.getFile ( key.toString ( ) ) ;
				uploadv2 ( file , request , "/"  ) ;
				uploadv2 ( file , request , "/" , "ddddddd"  ) ;
				uploadv2 ( file , request , "/" , null  ) ;
				uploadFilev2 ( file , request , "/fff.jpg"  ) ;
			}
			response.getWriter ( ).write ( "ok!" ) ; 
		
	
		return null;
	}
	
}
